import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/Main'
import Home from '../views/menu/Home'
import Allfile from '../views/menu/Allfile'
import Document from '../views/menu/Document'
import Picture from '../views/menu/Picture'
import Audio from '../views/menu/Audio'
import Video from '../views/menu/Video'
import Recycle from '../views/menu/Recycle'
import Test from '../views/menu/Test'
import Share from '../views/menu/Share'
import ShareLink from '../views/sharelink/ShareLink'
import Login from '../views/Login'
import Office from '../views/openoffice/Openoffice'

//引入router并使用
Vue.use(VueRouter)
//1.创建路由组件 就是路由页面
const routes = [

  //主路由
  {
    path:'/',
    redirect: 'home',
    component: Main,
    //嵌套路由子路由
    children:[
      //子路由路径一般不带"/" 以 / 开头的嵌套路径会被当作根路径。
      { path: 'home', component: Home },//首页
      { path: 'allfile',component:Allfile },//全部文件
      { path: 'document',component:Document},//文档
      { path: 'picture',component:Picture},//图片
      { path: 'audio',component:Audio},//音频
      { path: 'video',component:Video},//视频
      // { path: 'compress',component:Compress},//压缩包
      { path: 'recycle',component:Recycle},
      // { path: 'notes',component:Notes}//笔记
      {path: 'share',component:Share}//分享
    ]
  },
  {
    path:'/login',
    name:'login',
    component: Login
  },
  {
    path:'/test',
    name:'test',
    component: Test
  },
  {
    path: '/office/:id/:flag',
    name: 'office',
    component: Office
  },
  {
    path:'/sharelink/:id',
    name:'sharelink',
    component:ShareLink
  }
]



const router = new VueRouter({
  routes
})

export default router
